#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main()
{
    int m = 0;
    int n = 0;
    int count = 0;
    scanf("%d %d", &m, &n);
    int temp = m ^ n;
    while (temp)
    {
        temp &= temp - 1;
        count++;
    }
    printf("%d", count);
    return 0;
}